package com.konne.nightmare.FastPublicOpinion.ui.personal.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.konne.nightmare.FastPublicOpinion.R;
import com.konne.nightmare.FastPublicOpinion.utils.ToastUtil;

import butterknife.OnClick;

/**
 * @Author: chen
 * @UpdateDate: 1/23/22
 * @UpdateRemark:
 */
public class PrivacyDialog extends Dialog implements View.OnClickListener{
    private View contentView;
    private TextView tvAll;
    private TextView tvOnlyOneself;
    private TextView tvOnlyFriend;

    public PrivacyDialog( Context context) {
        super(context, R.style.popu_dialog);
        setCancelable(true);
        setCanceledOnTouchOutside(true);
        getWindow().setGravity(Gravity.BOTTOM);//设置显示在底部
        Window window = this.getWindow();
        window.getDecorView().setPadding(0, 0, 0, 0);
        WindowManager.LayoutParams params = window.getAttributes();
        params.width = WindowManager.LayoutParams.MATCH_PARENT;
        params.height = WindowManager.LayoutParams.WRAP_CONTENT;
        window.setAttributes(params);
        setContentView(R.layout.privacy_popu);
        contentView = findViewById(R.id.contentView);
        tvAll = findViewById(R.id.tv_all);
        tvOnlyOneself = findViewById(R.id.tv_only_oneself);
        tvOnlyFriend = findViewById(R.id.tv_only_friend);
        tvAll.setOnClickListener(this);
        tvOnlyOneself.setOnClickListener(this);
        tvOnlyFriend.setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_all:
                dismiss();
                break;
            case R.id.tv_only_oneself:
                dismiss();
                break;
            case R.id.tv_only_friend:
                dismiss();
                break;


        }
    }
}
